﻿<!DOCTYPE html>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>添加</title>
    <link href="http://g.alicdn.com/sj/dpl/1.5.1/css/sui.min.css" rel="stylesheet" />
    <link href="http://g.alicdn.com/sj/dpl/1.5.1/css/sui-append.css" rel="stylesheet" />
    <style type="text/css">
        .form-horizontal .controls > a:first-child,
        .form-horizontal .controls > span:first-child {
            display: inline-block;
            padding-top: 3px;
        }
        /* 表单的内容区如果一开始就是文字，应该和左边水平对齐 */
        /* 原bs里面的缩略图样式 */
        .img-round {
            border-radius: 3px;
            display: block;
            padding: 3px;
            border: 1px solid #ccc;
            position: relative;
        }

            .img-round img {
                height: 120px;
                width: 120px;
            }

            .img-round .upload-label {
                position: absolute;
                display: inline-block;
                padding: 5px 0;
                width: 80%;
                border: 1px solid #ccc;
                left: 10%;
                top: 48%;
                margin-top: -5px;
                background-color: #fff;
                text-align: center;
            }

        .controls .sub-controls-title {
            margin: 15px 0;
        }

        .sui-row-fluid .span2 {
            width: 120px;
        }

        .datepicker {
            z-index: 1000 !important;
        }
        .ms-controller{visibility:hidden;}


    </style>
</head>
<body ms-controller="commview" class="ms-controller">
    <div id="sui-form1" class="sui-form form-horizontal" style="padding-top:20px;">
        <div ms-include-src="../add/{{FunCode}}.html?rdm={{rdm}}" data-include-rendered='render' style="padding-bottom:50px;">

        </div>

        <div class="sui-navbar navbar-fixed-bottom" style="background-color: #F8F8F8;">
            <div class="sui-btn-group" style="width:98%; text-align:center;padding-bottom:5px;">
                <a class="sui-btn btn-xlarge btn-primary" ms-click="SaveData()" >保存</a>
                <!--<a class="sui-btn btn-xlarge btn-primary" ms-click="SaveData(this,'1')" >通过</a>-->
                <!--<a class="sui-btn btn-xlarge btn-danger" ms-click="SaveData(this,'2')" style="margin-left:5px;">拒绝</a>-->

                <a class="sui-btn btn-xlarge" ms-click="cancel()" style="margin-left:5px;">取消</a>

            </div>

        </div>
    </div>

    <script type="text/javascript" src="http://g.alicdn.com/sj/lib/jquery/dist/jquery.min.js"></script>
    <script src="https://cdn.bootcss.com/Sortable/1.5.1/Sortable.min.js"></script>
    <script type="text/javascript" src="http://g.alicdn.com/sj/dpl/1.5.1/js/sui.min.js"></script>
    <script src="../js/layer/layer.js"></script>
    <script src="https://cdn.bootcss.com/avalon.js/1.5.9/avalon.js"></script>
    <script src="../js/ComFunJS.js?v=20180101"></script>
    <script src="../js/ydui.citys.js"></script>
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=NVpVKdH67Id8f94IDAFX9nHXOGW58Abt"></script>
    <script type="text/javascript">
      var lyindex = parent.layer.getFrameIndex(window.name);

      var pmodel = avalon.define({
          $id: "commview",
          ID: ComFunJS.getQueryString("ID",""),//数据ID
          FunCode: ComFunJS.getQueryString("funcode"),
          rdm:Math.random(),
          render: function () {
              if (tempmodel) {
                  tempmodel.Init(pmodel.ID);
              }
              //if (tempmodel) {
              //    tempmodel.inittemp(pmodel.ID);
              //    if (parent.layer) {
              //        var index = parent.layer.getFrameIndex(window.name)
              //        parent.layer.title(tempmodel.name, index)
              //    }
              //}
          },
          SaveData: function (dom,status) {
              $("#sui-form1").validate();
              $("#sui-form1").submit();

              if ($("#sui-form1 div.msg-error:visible").length == 0) {
                  if (tempmodel) {
                      tempmodel.tmpSaveData(lyindex);
                  }
              }

          },
          FileData: [],
          FileUpload: function () {
              ComFunJS.fileUpload(function (result) {
                  result.forEach(function (item, index) {
                      pmodel.FileData.push(item.ID);
                  })

              })
          },
          GetFileIds: function () {
              //var ids = "";
              //pmodel.FileData.forEach(function (item, index) {
              //    if (ids == "") {
              //        ids = item.ID;
              //    } else {
              //        ids = ids + "," + item.ID;
              //    }
              //})
              //return ids;
              return pmodel.FileData.toString();
          },
          DelFile: function (el) {
              if (el) {
                  pmodel.FileData.remove(el);
              }
          },
          cancel: function () {
              top.ComFunJS.close(lyindex);
          },
          CityData1: [],
          CityData2: [],
          CityData3: [],
          tempCity: [],
          GetCityData1: function () {
              if (citys) {
                  citys.forEach(function (value, index) {
                      pmodel.CityData1.push(value.n);
                  })
              }
          },
          GetCityData2: function (t) {
              if (citys) {
                  pmodel.CityData2.clear();
                  pmodel.CityData3.clear();
                  citys.forEach(function (value, index) {
                      if (t == value.n) {
                          pmodel.tempCity = value.c;
                          value.c.forEach(function (value2, index2) {
                              pmodel.CityData2.push(value2.n);
                          })
                      }

                  })
              }
          },
          GetCityData3: function (t) {
              if (pmodel.tempCity) {
                  pmodel.CityData3.clear();
                  pmodel.tempCity.forEach(function (value, index) {
                      if (t == value.n) {
                          value.a.forEach(function (value2, index2) {
                              pmodel.CityData3.push(value2);
                          })
                      }

                  })
              }
          }
      })

      avalon.ready(function () {

          ComFunJS.initForm();
          pmodel.GetCityData1();

      });
      
    </script>

    
    <link href="../js/umeditor122/themes/default/css/umeditor.css" rel="stylesheet" />
    <script src="../js/umeditor122/umeditor.js?v=2018030401"></script>
    <script src="../js/umeditor122/umeditor.config.js"></script>
    
</body>

</html>
